<template>
  <div>
    <rules-cmp :title="title" @saveRules="handleSaveRules"></rules-cmp>
  </div>
</template>
<script>
import RulesCmp from "@/views/course/rules-cmp"
import { Message } from "element-ui"
import { setReword } from "@/api/operation"
import {ERR_OK} from '@/api/config'
export default {
  data() {
    return {
      title: "奖励设置"
    };
  },
  components: {
    RulesCmp
  },
  methods: {
    handleSaveRules(content) {
      this._setReword(content)
    },
    _setReword(content) {
      setReword(content)
        .then(res => {
          if (res.code == ERR_OK) {
            console.log(res)
            Message({
              message: res.message,
              type: "info"
            })
          }
        })
        .catch(err => {
          console.log(err)
        });
    }
  }
};
</script>
<style lang="scss" scoped>
</style>